package com.ad.pet.app.photo.loader;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ad.pet.R;
import com.ad.pet.app.photo.model.ImageBucket;
import com.ad.pet.common.data.utils.glide.GlideUtil;

import java.util.List;

/**
 * Created by z on.
 * Des:相册adapter
 * Date: 2017/3/31
 */

public class BucketAdapter extends BaseQuickAdapter<ImageBucket, BaseViewHolder> {
    public BucketAdapter(List<ImageBucket> data) {
        super(R.layout.item_bucket_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ImageBucket item) {
        GlideUtil.load(mContext, item.getImageList().get(0).getImagePath(), (ImageView) helper.getView(R.id.iv_icon));
        helper.setText(R.id.tv_bucket, item.getBucketName())
                .setText(R.id.tv_image_count, "("+item.getImageList().size()+")");
    }
}
